//logs.js
const util = require('../../utils/util.js')
const app = getApp()

Page({
  
  data: {
    "a1": [
      {
        id: 1,
        title: "陈鸿宇的个人介绍"
      }],

    "a2": [
      {
        id: 1,
        title: "谢春花的个人介绍"
      }],
    "a3": [
      {
        id: 1,
        title: "陈粒的个人介绍"
      }],

    imgUrls: [
      "https://wx1.sinaimg.cn/mw1024/49018dcbly1fn1g73f7dcj208c05hjrn.jpg",
      "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1576058017014&di=e00ca97c997186719dec24e1e49447ab&imgtype=0&src=http%3A%2F%2Fwx3.sinaimg.cn%2Flarge%2F006h2Bs1ly1fyhnpebwjqj30jr0b40ze.jpg",
      "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1576057980376&di=ff9b0fbf3785ad8d59808e756f9b46d2&imgtype=0&src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2F05988d4ede9c28faf4aef80165bdb09992238811200c0-gKFdho_fw658"],
    currentSwiper: 0,
    autoplay: true,
    interval: 2000,
    logs: []
  },
  onLoad: function () {
    this.setData({
      logs: (wx.getStorageSync('logs') || []).map(log => {
        return util.formatTime(new Date(log))
      })
    })
  },
  onArticleOnclick: function (event) {
    var dataset = event.currentTarget.dataset;
    var id = dataset.id;
    console.log(event)
    wx.navigateTo({
      url: '/pages/article/article?id=' + id,
    })},
  onrticleOnclick: function (event) {
    var dataset = event.currentTarget.dataset;
    var id = dataset.id;
    console.log(event)
    wx.navigateTo({
      url: '/pages/rticle/rticle?id=' + id,
    })
  }, 
  onticleOnclick: function (event) {
    var dataset = event.currentTarget.dataset;
    var id = dataset.id;
    console.log(event)
    wx.navigateTo({
      url: '/pages/ticle/ticle?id=' + id,
    })
  }
})
